<?php
namespace home\controller;
use home\controller\HomeBaseController;
use common\helper\FinanceHelper;

class IndexController extends HomeBaseController{
    public function __construct()
    {
        parent::__construct();
    }

    public function indexAction()
    {
        /**
        load_class('restclient');
        $restclient = new \restclient();
        $restclient->setContentFormat('json');
        $restclient->call('http://dev.backend.jimushop.cc/home/user/index','POST',array('username'=>'will','jjk'=>time()));
        */
        return $this->addAction();
    }

    public function checkcodeAction()
    {
        session_start();
        $code = load_class('checkcode');
        $code->width = 120;
        $code->height = 38;
        $code->doimage();

        $_SESSION['code'] = strtolower($code->get_code());
    }


    public function addAction()
    {
        return FinanceHelper::round_bcadd(1,10);
    }

    public function demoAction()
    {
        return 'home/index/demo';
    }
}